package com.dblog.server.model.tblog;


import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;
import com.google.appengine.api.users.User;

import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class Post {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent
    private User author;
    
    @Persistent
    private String title;

	@Persistent
    private Text content;

    @Persistent
    private Date date;
    
    @Persistent
    private String tags;

    public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

    public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Post(User author, Text content, Date date, String tags) {
        this.author = author;
        this.content = content;
        this.date = date;
        this.tags = tags;
    }

    public Post() {
		// TODO Auto-generated constructor stub
	}

	public Key getKey() {
        return key;
    }

    public User getAuthor() {
        return author;
    }

    public Text getContent() {
        return content;
    }

    public Date getDate() {
        return date;
    }

    public void setAuthor(User author) {
        this.author = author;
    }

    public void setContent(Text content) {
        this.content = content;
    }

    public void setDate(Date date) {
        this.date = date;
    }
}
